package com.tsd.system.service;

import com.tsd.core.vo.PageBean;
import com.tsd.system.entity.*;

import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * 描述：SysResource服务实现层接口
 *
 * @author Hillpool
 * @date 2019/03/12 12:20:51
 */
public interface SysResourceService {

    /**
     * 描述：根据id获取SysResource
     *
     * @param id
     */
    SysResource getSysResourceById(Long id) throws Exception;

    SysResourceExt queryBySid(String sid) throws Exception;

    /**
     * 描述：保存或更新SysResource
     *
     * @param record
     * @param sysUser
     */
    void saveSysResource(SysResource record, SysUser sysUser) throws Exception;

    /**
     * 描述：根据id删除SysResource
     *
     * @param id
     */
    void deleteSysResource(Long id, SysUser sysUser) throws Exception;

    /**
     * 描述：根据params分页查询SysResource
     *
     * @param params
     * @param page
     */
    List<SysResourceExt> findSysResources(Map<String, Object> params, PageBean page) throws Exception;

    List<SysResourceExt> findSysResourceTree(String parentSid) throws Exception;

    List<SysResourceExt> findSysResourceTree4User(String parentSid, SysUser opUser) throws Exception;

    void updateSysResouceParentId(String sid, String newParentId, SysUser opUser) throws Exception;

    List<SysResourceExt> findSysResource4User(String userSid) throws Exception;

    List<SysResourceExt> queryValidApps(SysUser opUser) throws Exception;

    List<SysResourceExt> findSysResourceTreeByRole(String roleSid, String parentId) throws Exception;

    Set<String> query4ShiroAuthorizationInfo(List<SysRoleExt> roleExtList, SysUserExt userExt) throws Exception;
}
